package pl.edu.agh.lab2.sr.server;

import java.rmi.Remote;
import java.rmi.RemoteException;
import java.util.List;

import pl.edu.agh.lab2.sr.beans.GameAlreadyCreatedException;
import pl.edu.agh.lab2.sr.beans.InvalidUserException;
import pl.edu.agh.lab2.sr.game.IBattleshipGame;
import pl.edu.agh.lab2.sr.player.IPlayer;

public interface IBattleshipServer extends Remote {

	void register(IPlayer player) throws RemoteException, InvalidUserException;

	void unregister(IPlayer player) throws RemoteException,
			InvalidUserException;

	List<String> getRegisteredPlayers() throws RemoteException;

	int createBattleshipGame(IPlayer player) throws RemoteException, GameAlreadyCreatedException, InvalidUserException;

	void removeGame(IPlayer player) throws RemoteException;
	
	List<String> getGamesList() throws RemoteException;

	IBattleshipGame join(IPlayer player, int gameId) throws RemoteException, InvalidUserException;

	IBattleshipGame getGameById(int gameId) throws RemoteException;

}
